using UnityEngine;
using System.Collections;

public class CarDrive : MonoBehaviour {
	
	public bool drive = false;
	float carSpeed = 40;
	
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		if(drive){
			rigidbody.AddForce(Vector3.left * carSpeed * Time.deltaTime,ForceMode.VelocityChange);
		}
	}
	
	void OnTriggerEnter (){
		drive = true;
	}
}
